import request from '@/utils/request'

export default {
    //条件+分页查询所有博客
    getBlogList(current,size,blogInline){
        return request({
            //url: '/context/blog/listPage/'+current+'/'+size,
            url: `/context/blog/listPage/${current}/${size}`,
            method: 'post',
            data: blogInline
          })
    },

    //保存博客方法
    saveBlog(blog){
        return request({
            //url: '/context/blog/listPage/'+current+'/'+size,
            url: `/context/blog/saveBlog`,
            method: 'post',
            data: blog
          })
    },

    //根据id删除blog  delete/{id}
    deleteBlog(blogId){
    return request({
        //url: '/context/blog/listPage/'+current+'/'+size,
        url: `/context/blog/delete/${blogId}`,
        method: 'delete',
      })
    },
    //根据id查询blog  
    selectOne(blogId){
        return request({
            url: `/context/blog/selectOne/${blogId}`,
            method: 'get',
          })
        },
        //更新blog  
    updateOne(blog){
        return request({
            url: `/context/blog/updateOne`,
            method: 'post',
            data:blog
          })
        }
}
